package com.eat.netty_server.controller;

import com.eat.netty_server.bean.ManageConnections;
import io.netty.buffer.Unpooled;
import io.netty.util.CharsetUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.nio.charset.Charset;

/**
 * @author CZF
 * @create 2022-03-30 16:49
 */

@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("ttt")
    public void test1(){
        System.out.println("test");
        ManageConnections.channelList.get(1L).writeAndFlush(Unpooled.copiedBuffer("接口能发送请求", CharsetUtil.UTF_8));
    }
}
